counting occurrences of character in string python